package cn.itsource.controller;

import cn.itsource.bean.SearchMasterMsg;
import cn.itsource.query.SearchMsgQuery;
import cn.itsource.service.ISearchMasterMsgService;
import cn.itsource.util.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author : 张金铭
 * @description :
 * @create :2022-11-20 17:34:00
 */
@Slf4j
@RestController
@RequestMapping("/searchmsg")
public class SearchMasterMsgController {

    @Resource
    private ISearchMasterMsgService searchMasterMsgService;



    @PostMapping("/pagelist")
    public JsonResult getPage(@RequestBody SearchMsgQuery query,HttpServletRequest request){
        return searchMasterMsgService.getPage(query,request);
    }

    /**
     * 接单，接单同时选择支付方式
     * @param msg
     * @param request
     * @return
     */
    @PostMapping("/access")
    public JsonResult access(@RequestBody SearchMasterMsg msg, HttpServletRequest request){
        return searchMasterMsgService.access(msg,request);
//        return null;
    }
}
